import Vue from 'vue'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import App from './App.vue'

import VueResource from 'vue-resource';
Vue.use(VueResource);

import VueRouter from "vue-router"
//开启debug模式
Vue.config.debug = true;
Vue.use(VueRouter);


Vue.use(MintUI)

import moren from './components/default.vue'
import zhuce from './components/zhuce.vue'
import denglu from './components/denglu.vue'
import news from './components/news.vue'

import donate from './components/index/donate.vue'
import need from './components/index/need.vue'
import pinglun from './components/index/pinglun.vue'

import myself from './components/myself.vue'
import mypl from './components/myself/mypl.vue'
import myzan from './components/myself/myzan.vue'
import myadress from './components/myself/myadress.vue'

import shangchuan from './components/shangchuan.vue'

import store from './vuex/store'
import zahuo from './components/zahuo.vue'

// 创建一个路由器实例并且配置路由规则
const router = new VueRouter({
  mode: 'history',
  base: __dirname,
  routes: [
      {
          path: '/',
          component:moren,
           children: [
              { path: '/donate', component: donate },
              { path: '/need', component: need }
          ]
      },
       {
          path: '/pinglun',
          component:pinglun
      },
      {
          path: '/zhuce',
          component:zhuce
      },
      {
          path: '/denglu',
          component:denglu
      },
      {
          path: '/news',
          component:news
      },
      {
          path: '/myself',
          component:myself
      },
      {
          path: '/mypl',
          component:mypl
      },
      {
          path: '/myzan',
          component:myzan
      },
      {
          path: '/myadress',
          component:myadress
      },
      {
          path: '/shangchuan',
          component:shangchuan
      },
      {
          path: '/zahuo',
          component:zahuo
      }
  ]
})

// 路由器会创建一个 App 实例，并且挂载到选择符 #app 匹配的元素上。
const app = new Vue({
      router: router,
      store,
      render: h => h(App)
}).$mount('#app')

